from urllib import request

class HtmlDownloader(object):
    def download(self, url):
        if url is None:
            return None
        response = request.urlopen(url)
        if response.getcode() != 200:
            return None
        return response.read().decode('utf-8')

if __name__ == '__main__':
    downloader = HtmlDownloader()
    content = downloader.download('https://baike.baidu.com/item/Python/407313')
    print(content)